#ifndef JREADWRITELOCK_P_H
#define JREADWRITELOCK_P_H

#include "jreadwritelock.h"
#include <QReadWriteLock>

// - class JReadWriteLockPrivate -

/**
 * @brief The JReadWriteLockPrivate class
 */
class JReadWriteLockPrivate
{
public:
    JReadWriteLockPrivate(QReadWriteLock *base, bool ref = false)
        : base(base)
        , ref(ref)
    {

    }

    ~JReadWriteLockPrivate()
    {
        if (ref == false) {
            delete base;
        }
    }

    QReadWriteLock *base;
    bool ref;
};

// - class JReadLockerPrivate -

/**
 * @brief The JReadLockerPrivate class
 */
class JReadLockerPrivate
{
public:
    JReadLockerPrivate(JReadWriteLock *readWriteLock)
        : base(readWriteLock->base())
        , readWriteLock(readWriteLock)
    {

    }

    QReadLocker base;
    JReadWriteLock *readWriteLock;
};

// - class JWriteLockerPrivate -

/**
 * @brief The JWriteLockerPrivate class
 */
class JWriteLockerPrivate
{
public:
    JWriteLockerPrivate(JReadWriteLock *readWriteLock)
        : base(readWriteLock->base())
        , readWriteLock(readWriteLock)
    {

    }

    QWriteLocker base;
    JReadWriteLock *readWriteLock;
};

#endif // JREADWRITELOCK_P_H
